package com.starhub.application.agent.enums;

/**
 * 大模型消息对话类型枚举
 */
public enum ChatMessageTypeEnum {
    SYSTEM("system", "系统消息"),
    USER("user", "用户消息"),
    ASSISTANT("assistant", "助手消息"),
    TOOL("tool", "工具调用消息"),
    FUNCTION("function", "函数调用消息");

    private final String code;
    private final String description;

    ChatMessageTypeEnum(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    /**
     * 根据code获取枚举实例
     */
    public static ChatMessageTypeEnum getByCode(String code) {
        for (ChatMessageTypeEnum type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
} 